package com.example.s01_helloworld.model;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

//@Data
//@Component
//public class WebInfo
//{
//    @Value("${example.name}")
//    private String name;
//    @Value("${example.title}")
//    private String title;
//}


// 方式二
@Data
@Component
@ConfigurationProperties(prefix = "example")
public class WebInfo
{
    private String name;
    private String title;
}